package cn.xiyan.baas.utils;

import sun.net.ProgressEvent;
import sun.net.ProgressListener;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @author: ruiyanglee
 * @date: 2020-09-11 16:14
 * @description: 实时进度条的工具类
 */
public class MyProgressListener implements ProgressListener {
    private HttpSession session;
    private Map<String,String> map;

    public MyProgressListener(HttpServletRequest request){
        session = request.getSession();
        // 将数据通过session实时发送到前端
        session.setAttribute("data", map);
    }

    @Override
    public void progressStart(ProgressEvent progressEvent) {

    }

    @Override
    public void progressUpdate(ProgressEvent progressEvent) {

    }

    @Override
    public void progressFinish(ProgressEvent progressEvent) {

    }
}
